package com.itheima.boottlias.controller;

import com.itheima.boottlias.domain.entity.NameValue;
import com.itheima.boottlias.domain.vo.ClazzOption;
import com.itheima.boottlias.domain.vo.JobOption;
import com.itheima.boottlias.domain.vo.Result;
import com.itheima.boottlias.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ghy
 * @version 1.0
 * @since 2025-07-14 16:13
 */
@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {

    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<NameValue> list = reportService.getEmpGenderData();
        return Result.success(list);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<NameValue> list = reportService.getStudentDegreeData();
        return Result.success(list);
    }


    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        ClazzOption clazzOption = reportService.getStudentCountData();
        return Result.success(clazzOption);
    }




}
